/* SPDX-License-Identifier: GPL-2.0 */
/*
 *
 * Copyright (C) 2016-2018, LomboTech Co.Ltd.
 * Authors:
 *	lomboswer <lomboswer@lombotech.com>
 *
 * This program is free software; you can redistribute  it and/or modify it
 * under  the terms of  the GNU General  Public License as published by the
 * Free Software Foundation;  either version 2 of the  License, or (at your
 * option) any later version.
 */

#ifndef _LOMBO_VGSS_H_
#define _LOMBO_VGSS_H_

struct device;
struct lombo_vgss_clk;

struct lombo_vgss_clk *lombo_vgss_get_clk(struct device *vgss_top,
	struct device *mod, unsigned int vgss_mod, unsigned int sclk_id);
int lombo_vgss_put_clk(struct lombo_vgss_clk **clk);
uint32_t lombo_vgss_clk_get_parent(struct lombo_vgss_clk *child);

int lombo_vgss_clk_set_parent(struct lombo_vgss_clk *child, uint32_t sclk_id);

unsigned long lombo_vgss_clk_get_rate(struct lombo_vgss_clk *clk);
int lombo_vgss_clk_set_rate(struct lombo_vgss_clk *clk, unsigned long rate);

int lombo_vgss_clk_prepare_enable(struct lombo_vgss_clk *clk, int sw);
int lombo_vgss_clk_disable_unprepare(struct lombo_vgss_clk *clk);

/*
 * get a enabled timer clock
 * @req_rate: required-rate.
 * @real_rate: real rate returned.
 */
struct lombo_vgss_clk *lombo_vgss_get_enable_tclk(struct device *vgss_top,
	unsigned long req_rate, unsigned long *real_rate);
#endif /* #ifndef _LOMBO_VGSS_H_ */
